package com.example.server.controller;

import com.example.server.entity.Chapter;
import com.example.server.service.ChapterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/chapters")
public class ChapterController {

    @Autowired
    private ChapterService chapterService;

    @GetMapping("/{id}")
    public Chapter getChapterById(@PathVariable int id) {
        return chapterService.getChapterById(id);
    }
}
